package com.iot.device.service.impl;

import java.util.List;
import com.iot.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.PressureSensorParamMapper;
import com.iot.device.domain.PressureSensorParam;
import com.iot.device.service.IPressureSensorParamService;

/**
 * 压力传感器设备参数Service业务层处理
 * 
 * @author iot
 * @date 2023-06-13
 */
@Service
public class PressureSensorParamServiceImpl implements IPressureSensorParamService 
{
    @Autowired
    private PressureSensorParamMapper pressureSensorParamMapper;

    /**
     * 查询压力传感器设备参数
     * 
     * @param id 压力传感器设备参数主键
     * @return 压力传感器设备参数
     */
    @Override
    public PressureSensorParam selectPressureSensorParamById(Long id)
    {
        return pressureSensorParamMapper.selectPressureSensorParamById(id);
    }

    /**
     * 查询压力传感器设备参数列表
     * 
     * @param pressureSensorParam 压力传感器设备参数
     * @return 压力传感器设备参数
     */
    @Override
    public List<PressureSensorParam> selectPressureSensorParamList(PressureSensorParam pressureSensorParam)
    {
        return pressureSensorParamMapper.selectPressureSensorParamList(pressureSensorParam);
    }

    /**
     * 新增压力传感器设备参数
     * 
     * @param pressureSensorParam 压力传感器设备参数
     * @return 结果
     */
    @Override
    public int insertPressureSensorParam(PressureSensorParam pressureSensorParam)
    {
        pressureSensorParam.setCreateTime(DateUtils.getNowDate());
        return pressureSensorParamMapper.insertPressureSensorParam(pressureSensorParam);
    }

    /**
     * 修改压力传感器设备参数
     * 
     * @param pressureSensorParam 压力传感器设备参数
     * @return 结果
     */
    @Override
    public int updatePressureSensorParam(PressureSensorParam pressureSensorParam)
    {
        pressureSensorParam.setUpdateTime(DateUtils.getNowDate());
        return pressureSensorParamMapper.updatePressureSensorParam(pressureSensorParam);
    }

    /**
     * 批量删除压力传感器设备参数
     * 
     * @param ids 需要删除的压力传感器设备参数主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorParamByIds(Long[] ids)
    {
        return pressureSensorParamMapper.deletePressureSensorParamByIds(ids);
    }

    /**
     * 删除压力传感器设备参数信息
     * 
     * @param id 压力传感器设备参数主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorParamById(Long id)
    {
        return pressureSensorParamMapper.deletePressureSensorParamById(id);
    }

    @Override
    public PressureSensorParam pressureSensorParamBySn(String sn) {
        return pressureSensorParamMapper.pressureSensorParamBySn(sn);
    }
}
